package cn.com.dashihui.pay.wxpay;


import java.util.List;

import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;

import org.junit.Test;

import com.jfinal.kit.PathKit;
import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

import cn.com.dashihui.api.common.OrderCode;
import cn.com.dashihui.api.common.SysConfig;
import cn.com.dashihui.kit.DatetimeKit;
import cn.com.dashihui.pay.alipay.sign.Base64;
import cn.com.dashihui.pay.wx.kit.AESUtil;
import cn.com.dashihui.pay.wx.kit.HttpsRequest;
import cn.com.dashihui.pay.wx.kit.MD5;
import cn.com.dashihui.pay.wx.kit.UtilKit;
import cn.com.dashihui.pay.wx.request.RefOrderReqData;
import cn.com.dashihui.pay.wx.response.RefNoticeResInfo;
import cn.com.dashihui.pay.wx.response.RefOrderResData;


public class test1 {
	
	
	/*
	 * 创建用户查询商品订单快递信息的方法
	 */
	@Test
	public  void getDelivelyInformation() throws Exception {
		
//		PropKit.use("config.test.properties");
//		String orderNum = "T20190903104215694980";
//		String out_refund_no = "TT20190903105422677318";
//		String total_fee = "1";
//		
//		//向微信发起退款请求
//		RefOrderReqData reOrderReqData = new RefOrderReqData(orderNum,out_refund_no,total_fee,total_fee, "免单退款");
//		RefOrderResData reOrderRspData = null;
//		try {
//			String certpath = PathKit.getRootClassPath()+"/"+PropKit.get("weixinpay.open.cert");
//			String certpassword = PropKit.get("weixinpay.mch_id");
//			String post = new HttpsRequest(certpath,certpassword).post("https://api.mch.weixin.qq.com/secapi/pay/refund", reOrderReqData);
//			System.out.println("<<<<<<<<<<<<<:"+post+":>>>>>>>>>>>>>>>");
//		}catch(Exception e){
//			e.printStackTrace();
//			}
		
//		String info = "tqeciwn9beddABFtzCwzCta0exn9m1uYncF1VhXmCCvLnl3SdCz5r1xnhVCcsWa0I7KXCaz4fbaR760lny/4AnY7bBWuYcjtLs10Q4rKRfy/loVnov1rw3VGDXN22fj7+q21GEGQvEw6ZuKUPcF8kWBmocmfLlU3YgZfXelBQbtssf8F0Mo2HFO1EqyPRcCIk7hOHJZ5zxda+uGPuD4LEijCLMFmPOSZD/mfLb2pW3o0yEZBNRfNizXdgnMysYQ7gNz5xlPHY72gfT3cZDmeViJivQDdtDJRMGHxEpVVu4TvvgG/7i03zJlc1SsrQmmXHkN4LgIO0qi9SgsNzUqf2L5Pmrr7/JjwqXMKsX52W2qB38cR2A6cQNLOhCwjlLKGvZLYKviymN5kPfHhtSV8GSS1VSRrS3i2bmynwwWpqJ/2o72jRNsarfEMgST1GMsSotqvbpDXmihkTAgw2VqaiiSpF0SAdgaib+o0XMUecX9hCrvscFvBVqix07uo4IXDyCCKDGyDpgUKtH2+WOoVgxwXfbZY8HpbVRGt761HU6VZtRsOebfsMOYry9zplD2GOJqj/50CDuw7zgNk2cG0gKJ2IptYDLMVXMurPNOSp7Hfhg+Tk0O1UxuQFkCWq3t4dS5x4Vn6xCuiM/Y2ZyShbEhR6eVhWql2OIhGiS+fX6tkznWN6uHR6ZB6cWty6EJuaDq4nUdW8sFQ04TEB+0wk24OEeS663Blh7XiIVM/rMJzOMaY5MLM25alKVaLK3uA2u6vnzyQBl3qmkjYlc9nzzB6yRk8KPhAj9JZZ+5kqNOhO3N6wSEsrXjODb3nD09MFzXq9yHr4YWehPBHPcI0vG5vd8LeoPKzkzDCEYxW31u3JTGdaCRYOblygQ1kr7Bs8PLCjWeOMy5zqYkoWx3QiA9ZB5vGJSjzgTsqRdmEL8xg56p0UqAWLpguUbwS6fvXvPBHar+EDn0HLhkwck7Pdn3zl/9NsMYmxjZjF0tLyBztMxg+d5nURNv2xLQaroFyKwY5L+gqLfdrFDxxHp9K9uIE7t/XfLMOpY1azDeVDAU=";
//		String key = PropKit.get("weixinpay.key");
//		info = AESUtil.decryptData(info,key);
//		info = info.replace("root", "xml");
//		System.out.println("<<<<<<<<<<<<<:"+info+":>>>>>>>>>>>>>>>");
//		RefNoticeResInfo refNoticeResInfo = (RefNoticeResInfo)UtilKit.getObjectFromXML(info,RefNoticeResInfo.class);
//		System.out.println("<<<<<<<<<<<<<:"+refNoticeResInfo.getOut_refund_no()+":>>>>>>>>>>>>>>>");
	}

}
